
#include "MusicManager.h"
#include "AudioUtils.h"
#include "ProgressManager.h"

void MusicManager::load()
{
    AudioUtils::preloadMusic("HungryBirths_Mix2.mp3");
}

void MusicManager::unload()
{
    AudioUtils::unloadMusic("HungryBirths_Mix2.mp3");
}

void MusicManager::playMusic()
{
    if(!m_bMusicPlaying && ProgressManager::instance().getSavedData().bMusic)
    {
        AudioUtils::playMusic("HungryBirths_Mix2.mp3", true);
        m_bMusicPlaying = true;
        setMusicVolume(MUSIC_VOLUME);
    }
}

void MusicManager::stopMusic()
{
    AudioUtils::stopMusic("HungryBirths_Mix2.mp3");    

    m_bMusicPlaying = false;
}

void MusicManager::setMusicVolume(float _fVolume)
{
    AudioUtils::setMusicVolume("HungryBirths_Mix2.mp3", _fVolume);
}
